<?php

/*
 *
 *
 * This software has been made FREE by author for the interest of other developers. 
 *      I hope this will help you in coding faster and robust php code
 *            You can modify and redistribute it as you like.
 *              Your comments, suggestions and corrections 
 *                          will be highly 
 *                           APPRECIATED. 
 *                                      Author
 * @author :   Roshan Budhathoki (developer.roshan@gmail.com);
 * @URL    :   <http://www.roshanbudhathoki.com>
 *
 * 
 * Main Launcher for Myhighst Admin
 */

/*
 * *************************
 * CHECK IF ADMIN LOGGED IN
 * *************************
 */


if (! admin_logged_in ()) {
	Params::setParam ( 'page', 'login' );
}

/*
 * **************************************************
 * Check request type and run appropriate controller
 * **************************************************
 */
if (! Params::getParam ( 'page' )) {
	Params::setParam ( 'page', 'index' );
}

switch (Params::getParam ( 'page' )) {
	case 'login' :
		
		include cp_code_path () . 'login.php';
		
		break;
	case 'categories' :
		include cp_code_path () . 'categories.php';
		break;
	case 'items' :
		include cp_code_path () . 'items.php';
		break;
	case 'index' :
		include cp_template_path () . 'home.php';
		break;
	case 'unit' :
	
	default :
		echo '404 PAGE';
		break;
}